// 文件路径: src/main/java/com/macro/mall/tiny/modules/oms/model/User.java
package com.macro.mall.tiny.modules.oms.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@TableName("oms_user")
@Schema(description = "顾客表")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "user_id", type = IdType.AUTO)
    @Schema(description = "用户id")
    private Integer userId;

    @Schema(description = "手机号")
    private String phone;

    @Schema(description = "密码")
    @JsonIgnore  // 添加此注解以忽略密码字段
    private String password;

    @Schema(description = "名字")
    private String name;

    @Schema(description = "网点")
    private String branch;

    @Schema(description = "1-男，2-女，3-未知")
    private Integer sex;

    @Schema(description = "用户状态 1-生效,0-无效")
    private Integer status;

    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    @Schema(description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;

    @Schema(description = "软删除：0-正常，1-已删除")
    @TableField(updateStrategy = FieldStrategy.NOT_NULL)
    private Integer delFlag;
}
